#pragma once
#include "PxPhysicsAPI.h"
#include "Types.h"
#include "NvidiaPhysX.h"




namespace Boon
{
namespace Physics
{

	class SimulationCallback : public physx::PxSimulationEventCallback
	{

	public:
		SimulationCallback( const NvidiaPhysX::MapActorPerGameObject& a, const NvidiaPhysX::MapGOPerActor& go );

		virtual void onConstraintBreak( physx::PxConstraintInfo* constraints, physx::PxU32 count );
		virtual void onWake( physx::PxActor** actors, physx::PxU32 count );
		virtual void onSleep( physx::PxActor** actors, physx::PxU32 count );
		virtual void onContact( const physx::PxContactPairHeader& pairHeader, const physx::PxContactPair* pairs, physx::PxU32 nbPairs );
		virtual void onTrigger( physx::PxTriggerPair* pairs, physx::PxU32 count );


		const NvidiaPhysX::MapActorPerGameObject&				m_Actors;
		const NvidiaPhysX::MapGOPerActor&						m_GameObjects;
	};

	class SimulationFilterCallback : public physx::PxSimulationFilterCallback
	{
		public:
		
		static physx::PxFilterFlags OnCallFilterShader( physx::PxFilterObjectAttributes attributes0, physx::PxFilterData filterData0, physx::PxFilterObjectAttributes attributes1, physx::PxFilterData filterData1,	physx::PxPairFlags& pairFlags, const void* constantBlock, physx::PxU32 constantBlockSize);
		virtual physx::PxFilterFlags pairFound( physx::PxU32 pairID, physx::PxFilterObjectAttributes attributes0, physx::PxFilterData filterData0, physx::PxActor* a0, physx::PxShape* s0, physx::PxFilterObjectAttributes attributes1, physx::PxFilterData filterData1, physx::PxActor* a1, physx::PxShape* s1, physx::PxPairFlags& pairFlags );
		virtual void pairLost( physx::PxU32 pairID, physx::PxFilterObjectAttributes attributes0, physx::PxFilterData filterData0, physx::PxFilterObjectAttributes attributes1, physx::PxFilterData filterData1, bool objectDeleted );
		virtual bool statusChange( physx::PxU32& pairID, physx::PxPairFlags& pairFlags, physx::PxFilterFlags& filterFlags );

	};


}

}
